<?php


namespace app\admin\validate;

use think\Validate;

class User extends Validate
{   
   
    protected $rule = [
        'roles'    => 'require',
        'username' => 'unique:user|min:3',
        'email'    => 'unique:user'
    ];
    protected $message = [
        'roles.require'   => '请选择角色',
        'username.unique' => '对不起，用户名已被使用',
        'username.min'    => '对不起，用户名至少要三个字符',
        'email.unique'    => '对不起，邮箱已被占用',

    ];

    protected $scene = [
        'saveMyProfile' => ['username', 'email'],
        'editProfile' => [ 'roles','email'],
    ];

}
